@extends('admin.layout')
@section('content')
<div class="content-wrapper" style="min-height: 916px;">
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
               	分类管理
                <small>列表</small>
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i>后台主页</a></li>
                <li><a href="#">分类管理</a></li>
                <li class="active">列表</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content">
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                            <h3 class="box-title">快速查看分类列表</h3>
                        </div><!-- /.box-header -->
                        <div class="box-body">
							
						@if(session('info'))
							<div id="showHidden" class="alert alert-success alert-dismissable">
		                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
		                    <h4>	<i class="icon fa fa-check"></i> 提示!</h4>
		                    {{ session('info') }}
		                  </div>
						@endif

						 @if(session('error'))
                            <div id="showHidden" class="alert alert-danger alert-dismissable">
                            <button aria-hidden="true" data-dismiss="alert" class="close" type="button">x</button>
                                <h4><i class="icon fa fa-ban"></i>警告!</h4>
                                   {{ session('error') }} 
                            </div>
	                       @endif
    
                             <script type="text/javascript">
                                window.onload = function()
                                {
                                    setTimeout("$('#showHidden').hide( )",3000); 
        
                                }

                            </script>                           

                            <table class="table table-bordered table-hover dataTable" id="example2" role="grid" aria-describedby="example2_info">
                                <thead>
                                <tr>
									<th>ID</th>
									<th>分类名称</th>
									<th>父分类名称</th>
									
									<th>操作</th>

                                </tr>
                                </thead>
                                <tbody>
                                @foreach($data as $cate)
		                                <tr>
		                                    <td class='ids'>{{ $cate -> id}}</td>
		                                    <td class='name'>{{ $cate -> name}}</td>
		                                    <td>{{ $cate -> pname}}</td>
		                                    
		                                    <td>
		                                    <a href="{{url('/admin/cate/edit')}}/{{ $cate -> id}}">编辑</a> 
		                                    <span>|</span>
		                                    <a href="{{ url('/admin/cate/delete')}}/{{ $cate -> id}}">删除</a>
		                                    </td>
		                                </tr>
								@endforeach
                            </table>
                 
                        </div><!-- /.box-body -->
                    </div><!-- /.box -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </section><!-- /.content -->
    </div>

    </script>
@endsection